<?php

namespace App\Library\Traits\Orm;

use App\Models\ProductSpecModel;
use Illuminate\Database\Eloquent\Relations\HasMany;

trait ShopUserCollectOrmTrait
{
    public function specs(): HasMany
    {
        return $this->hasMany(ProductSpecModel::class, 'product_id', 'product_id')
            ->where('ps_is_delete', 2)->orderBy('ps_sort')->select([
                'product_id', 'ps_price', 'ps_price_underlined',
            ]);
    }
}
